﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Html RunCode Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="noindex, nofollow" name="robots">
<script type="text/javascript" src="../../dialog/common/fck_dialog_common.js"></script>
<link href="../../dialog/common/fck_dialog_common.css" type="text/css" rel="stylesheet">
<script language="javascript">
var dialog	= window.parent ;
var oEditor = window.parent.InnerDialogLoaded() ;
var FCKLang = oEditor.FCKLang ;
var FCKRunCode = oEditor.FCKRunCode ;

window.onload = function ()
{
    oEditor.FCKLanguageManager.TranslatePage( document ) ;
    window.parent.SetOkButton( true ) ; 
	
}
function Ok()
{
	var TextAreaCols = document.getElementById('TextAreaCols').value;
	var TextAreaRows = document.getElementById('TextAreaRows').value;

	if(TextAreaCols=='') { TextAreaCols = '70'; }
	if(TextAreaRows=='') { TextAreaRows = '15'; }

	var mytxt = document.getElementById('icTxt').value; 
/******Convert Begin (for bo-blog)******/
 /* */
	mytxt = mytxt.replace(/ /g, '　'); //此处为全角空格
	var maxlg=mytxt.split('\n').length;
	var vn = mytxt.split('\n');
	var re=/^\s+(\s)?$/gi;
	for(i=0;i<=maxlg-1;i++)
	{
		  if(vn[i].match(re)) 
		  {
		  //alert("第"+i+"行");
		  vn[i] = vn[i].replace(/\s/g, '　'); //此处为全角空格
		  }
	}
	for(i=maxlg-1;i>=0;i--)
	{
	vn[i-1] += '\n'+vn[i]; 
	}
	//alert(vn[0]);
	mytxt =vn[0];
	
/******Convert End******/
	
    FCKRunCode.Add( TextAreaCols,TextAreaRows,mytxt );
    return true ;
}
</script>
</head>
<body scroll="no" style="OVERFLOW: hidden;">
<table height="100%" cellSpacing="1" cellPadding="5" width="100%" border="0">
  <tr>
    <td><table align="center" border="0" cellPadding="5">
        <tr>
          <td style="vertical-align: top;"><span fckLang="DlgRunCodeArea">RunCode Area:</span>&nbsp;&nbsp;&nbsp;
	<span fckLang="DlgTextAreaCols">Cols:</span><input  type="text" id="TextAreaCols" size="2" value="70" />&nbsp;&nbsp;
	<span fckLang="DlgTextAreaRows">Rows:</span>&nbsp;<input  type="text" id="TextAreaRows" size="2" value="15" />&nbsp;
          </td>
        </tr>
        <tr>
          <td style="vertical-align: top;"><span fckLang="DlgRunCode">Code</span><br/>
	<textarea id="icTxt" cols="65" rows="17" style="font-family: 'Courier New', Monospace; border: 1px solid #ccc; padding: 5px;"></textarea></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
